package util;

public class JsonResult {
    private Boolean success = true;
    private String msg = "操作成功";
    //保存其他信息
    private Object resultObj;

    //获取当前对象
    public static JsonResult me(){
        return new JsonResult();
    }

    public JsonResult() {
    }
    public JsonResult(Boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public Boolean getSuccess() {
        return success;
    }


    public JsonResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public JsonResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getResultObj() {
        return resultObj;
    }

    public JsonResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }



    @Override
    public String toString() {
        return "JsonResult{" +
                "success=" + success +
                ", msg='" + msg + '\'' +
                ", resultObj=" + resultObj +
                '}';
    }

    public static void main(String[] args) {
        System.out.println(JsonResult.me().setSuccess(false).setMsg("呵呵").setResultObj("哈哈"));
    }
}
